import { getConfig } from '@/api/common';
import { getList as getAgentList } from '@/api/agent';
import { getList as getUserList } from '@/api/user';
import { getInfo } from '@/api/user';

export default {
  async getAllAgent() {
    this.allAgent = (await getAgentList({ size: 9999 })).data.list;
  },
  async getSelfInfo() {
    this.selfInfo = (await getInfo()).data;
  },

  async getAllUser() {
    this.allUser = (await getUserList({ size: 9999 })).data.list;
  },
  async getConfig() {
    this.cfg = (await getConfig()).data;
  },

  open(url) {
    window.open(url);
  }
};

export const sleep = time => new Promise(resolve => setTimeout(resolve, time));
